import React, { Component } from 'react'
import './notifaction.scss'
export default class Notifaction extends Component {
  static defaultProps={
    position:'leftTop'
  }
  closeMe=()=>{
    console.log('------------');
    this.props.closeNotify(false)
  }
  render() {
   switch(this.props.position){
     case 'leftTop':
        return (
            <div className='box' style={{left:10,top:10}}>
                <div className='title-box'>
                  <div>{this.props.title}</div>
                  <div onClick={this.closeMe}>&times;</div>
                </div>
                <div className='content-box'>{this.props.content}</div>
            </div>
          )
        case 'rightTop':
            return (
                <div className='box' style={{right:10,top:10}}>
                    <div className='title-box'>
                      <div>{this.props.title}</div>
                      <div onClick={this.closeMe}>&times;</div>
                    </div>
                    <div className='content-box'>{this.props.content}</div>
                </div>
              ) 
   }
   
  }
}
